<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  
  <link rel="shortcut icon" href="../../images/favicon.png">
  
  <title>Create - Daptin</title>
  <link href='https://fonts.googleapis.com/css?family=Muli:400,700|Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>
  <link href='https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' rel='stylesheet' type='text/css'>

  <link rel="stylesheet" href="../../css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../../css/theme_extra.css" type="text/css" />
  <link href="../../css/theme_extra.css" rel="stylesheet">
  
  <script>
    // Current page data
    var mkdocs_page_name = "Create";
    var mkdocs_page_input_path = "apis/create.md";
    var mkdocs_page_url = null;
  </script>
  
  <script src="../../js/jquery-2.1.1.min.js" defer></script>
  <script src="../../js/modernizr-2.8.3.min.js" defer></script> 
  
  <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

      ga('create', 'UA-114227400-1', 'docs.dapt.in');
      ga('send', 'pageview');
  </script>
  
</head>

<body class="wy-body-for-nav" role="document">

  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
      <div class="wy-side-nav-search">
        <a href="../.." class="icon icon-home"> Daptin</a>
        <div role="search">
  <form id ="rtd-search-form" class="wy-form" action="../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" title="Type search term here" />
  </form>
</div>
      </div>

      <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
	<ul class="tocbase current">
    
    
      
  <li class="navtree toctree-l1 label">
    <p class="caption">Daptin</p>
  </li>


  

  
    <li class="navtree toctree-l1 group">
      <ul class="navtree subnav-l1 current">
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../..">Introduction</a>
  </li>
        
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../setting-up/installation/">Installation</a>
  </li>
        
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../setting-up/settingup/">Getting started</a>
  </li>
        
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../setting-up/access/">User management</a>
  </li>
        
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../setting-up/data_modeling/">Data model</a>
  </li>
        
      </ul>
    </li>
    
      
  <li class="navtree toctree-l1 label">
    <p class="caption">API reference</p>
  </li>


  

  
    <li class="navtree toctree-l1 group">
      <ul class="navtree subnav-l1 current">
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../overview/">Overview</a>
  </li>
        
          
  <li class="navtree toctree-l2 label">
    <p class="caption">CRUD</p>
  </li>


  

  
    <li class="navtree toctree-l2 group">
      <ul class="navtree subnav-l2 current">
          


  <li class="navtree toctree-l3 inactive">
    <a class="" href="../read/">Read, search, filter</a>
  </li>
        
          


  
    
    <li class="navtree toctree-l3 page current">
      <a class="current" href="./">
        Create
      </a>
    </li>
    
      

  <li class="toctree-l3 current with-children">
    <a href="#create-api">
      Create API
      <span class="toctree-expand"></span>
    </a>
  </li>




  
        
          


  <li class="navtree toctree-l3 inactive">
    <a class="" href="../update/">Update</a>
  </li>
        
          


  <li class="navtree toctree-l3 inactive">
    <a class="" href="../delete/">Delete</a>
  </li>
        
          


  <li class="navtree toctree-l3 inactive">
    <a class="" href="../relation/">Relations</a>
  </li>
        
          


  <li class="navtree toctree-l3 inactive">
    <a class="" href="../execute/">Execute</a>
  </li>
        
      </ul>
    </li>
        
          
  <li class="navtree toctree-l2 label">
    <p class="caption">Features</p>
  </li>


  

  
    <li class="navtree toctree-l2 group">
      <ul class="navtree subnav-l2 current">
          


  <li class="navtree toctree-l3 inactive">
    <a class="" href="../../features/enable-graphql/">GraphQL</a>
  </li>
        
          


  <li class="navtree toctree-l3 inactive">
    <a class="" href="../../features/enable-data-auditing/">Data Auditing</a>
  </li>
        
          


  <li class="navtree toctree-l3 inactive">
    <a class="" href="../../features/enable-multilingual-table/">Multilingual Table</a>
  </li>
        
          


  <li class="navtree toctree-l3 inactive">
    <a class="" href="../../features/enable-smtp-imap/">SMTP/IMPS server</a>
  </li>
        
          


  <li class="navtree toctree-l3 inactive">
    <a class="" href="../../features/enable-logs/">Logs</a>
  </li>
        
      </ul>
    </li>
        
          
  <li class="navtree toctree-l2 label">
    <p class="caption">Action APIs</p>
  </li>


  

  
    <li class="navtree toctree-l2 group">
      <ul class="navtree subnav-l2 current">
          


  <li class="navtree toctree-l3 inactive">
    <a class="" href="../../actions/actions/">Using actions</a>
  </li>
        
          


  <li class="navtree toctree-l3 inactive">
    <a class="" href="../../actions/default_actions/">Actions list</a>
  </li>
        
          


  <li class="navtree toctree-l3 inactive">
    <a class="" href="../../actions/examples/">Examples</a>
  </li>
        
      </ul>
    </li>
        
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../state/machines/">State tracking</a>
  </li>
        
      </ul>
    </li>
    
      
  <li class="navtree toctree-l1 label">
    <p class="caption">OAuth Management</p>
  </li>


  

  
    <li class="navtree toctree-l1 group">
      <ul class="navtree subnav-l1 current">
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../extend/oauth_connection/">Connections</a>
  </li>
        
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../extend/oauth_token/">Tokens</a>
  </li>
        
      </ul>
    </li>
    
      
  <li class="navtree toctree-l1 label">
    <p class="caption">Integrations</p>
  </li>


  

  
    <li class="navtree toctree-l1 group">
      <ul class="navtree subnav-l1 current">
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../integrations/overview/">Overview</a>
  </li>
        
      </ul>
    </li>
    
      
  <li class="navtree toctree-l1 label">
    <p class="caption">Asset and file storage</p>
  </li>


  

  
    <li class="navtree toctree-l1 group">
      <ul class="navtree subnav-l1 current">
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../cloudstore/cloudstore/">Connecting with cloud store</a>
  </li>
        
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../cloudstore/assetcolumns/">Cloud store backed asset columns</a>
  </li>
        
      </ul>
    </li>
    
      
  <li class="navtree toctree-l1 label">
    <p class="caption">Sub-sites</p>
  </li>


  

  
    <li class="navtree toctree-l1 group">
      <ul class="navtree subnav-l1 current">
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../subsite/subsite/">Creating a subsite</a>
  </li>
        
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../subsite/grapes/">Live editing a subsite</a>
  </li>
        
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../subsite/basic_auth/">Basic Authentication</a>
  </li>
        
      </ul>
    </li>
    
      
  <li class="navtree toctree-l1 label">
    <p class="caption">Sharing</p>
  </li>


  

  
    <li class="navtree toctree-l1 group">
      <ul class="navtree subnav-l1 current">
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../extend/marketplace/">Marketplace</a>
  </li>
        
      </ul>
    </li>
    
      
  <li class="navtree toctree-l1 label">
    <p class="caption">Reference</p>
  </li>


  

  
    <li class="navtree toctree-l1 group">
      <ul class="navtree subnav-l1 current">
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../data-modeling/data_storage/">Data store format</a>
  </li>
        
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../extend/data_exchange/">Data exchange and sync</a>
  </li>
        
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../streams/streams/">Data streams</a>
  </li>
        
          


  <li class="navtree toctree-l2 inactive">
    <a class="" href="../../setting-up/enabling-features/">Enable/Disabling features</a>
  </li>
        
      </ul>
    </li>
    
  </ul>
      </div>
      &nbsp;
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
        <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
        <a href="../..">Daptin</a>
      </nav>

      
      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="breadcrumbs navigation">
  <ul class="wy-breadcrumbs">
    <li><a href="../..">Docs</a> &raquo;</li>
    
      
        
          <li>CRUD &raquo;</li>
        
      
        
          <li>API reference &raquo;</li>
        
      
    
    <li>Create</li>
    <li class="wy-breadcrumbs-aside">
      
    </li>
  </ul>
  <hr/>
</div>
          <div role="main">
            <div class="section">
              
                <h1 id="create-api">Create API<a class="headerlink" href="#create-api" title="Permanent link">Link</a></h1>
<div class="admonition note">
<p class="admonition-title">Curl Example</p>
<div class="codehilite"><pre><span></span>curl &#39;/api/&lt;EntityName&gt;&#39;
    -H &#39;Authorization: Bearer &lt;Token&gt;&#39;
    --data-binary &#39;{
                &quot;data&quot;: {
                    &quot;type&quot;: &quot;&lt;EntityName&gt;&quot;,
                    &quot;attributes&quot;: {
                        &quot;name&quot;: &quot;name&quot;
                    }
                }
           }&#39;
</pre></div>

</div>
<div class="admonition note">
<p class="admonition-title">Nodejs example</p>
<div class="codehilite"><pre><span></span><span class="kd">var</span> <span class="nx">request</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;request&#39;</span><span class="p">);</span>

<span class="kd">var</span> <span class="nx">headers</span> <span class="o">=</span> <span class="p">{</span>
    <span class="s1">&#39;Authorization&#39;</span><span class="o">:</span> <span class="s1">&#39;Bearer &lt;Token&gt;&#39;</span><span class="p">,</span>
<span class="p">};</span>

<span class="kd">var</span> <span class="nx">dataString</span> <span class="o">=</span> <span class="s1">&#39;{</span>
<span class="s1">                    &quot;data&quot;: {</span>
<span class="s1">                        &quot;type&quot;: &quot;&lt;EntityName&gt;&quot;,</span>
<span class="s1">                        &quot;attributes&quot;: {</span>
<span class="s1">                            &quot;name&quot;: &quot;name&quot;</span>
<span class="s1">                        }</span>
<span class="s1">                    }</span>
<span class="s1">                  }&#39;</span><span class="p">;</span>

<span class="kd">var</span> <span class="nx">options</span> <span class="o">=</span> <span class="p">{</span>
    <span class="nx">url</span><span class="o">:</span> <span class="s1">&#39;/api/&lt;EntityName&gt;&#39;</span><span class="p">,</span>
    <span class="nx">method</span><span class="o">:</span> <span class="s1">&#39;POST&#39;</span><span class="p">,</span>
    <span class="nx">headers</span>: <span class="kt">headers</span><span class="p">,</span>
    <span class="nx">body</span>: <span class="kt">dataString</span>
<span class="p">};</span>

<span class="kd">function</span> <span class="nx">callback</span><span class="p">(</span><span class="nx">error</span><span class="p">,</span> <span class="nx">response</span><span class="p">,</span> <span class="nx">body</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">error</span> <span class="o">&amp;&amp;</span> <span class="nx">response</span><span class="p">.</span><span class="nx">statusCode</span> <span class="o">==</span> <span class="mi">200</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">body</span><span class="p">);</span>
    <span class="p">}</span>
<span class="p">}</span>

<span class="nx">request</span><span class="p">(</span><span class="nx">options</span><span class="p">,</span> <span class="nx">callback</span><span class="p">);</span>
</pre></div>

</div>
<div class="admonition note">
<p class="admonition-title">Python example</p>
<div class="codehilite"><pre><span></span><span class="kn">import</span> <span class="nn">requests</span>

<span class="n">headers</span> <span class="o">=</span> <span class="p">{</span>
    <span class="s1">&#39;Authorization&#39;</span><span class="p">:</span> <span class="s1">&#39;Bearer &lt;Token&gt;&#39;</span><span class="p">,</span>
<span class="p">}</span>

<span class="n">data</span> <span class="o">=</span> <span class="s1">&#39;{</span>
            <span class="s2">&quot;data&quot;</span><span class="p">:</span> <span class="p">{</span>
                <span class="s2">&quot;type&quot;</span><span class="p">:</span> <span class="s2">&quot;&lt;EntityName&gt;&quot;</span><span class="p">,</span>
                <span class="s2">&quot;attributes&quot;</span><span class="p">:</span> <span class="p">{</span>
                    <span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;name&quot;</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span><span class="s1">&#39;</span>

<span class="n">response</span> <span class="o">=</span> <span class="n">requests</span><span class="o">.</span><span class="n">post</span><span class="p">(</span><span class="s1">&#39;/api/&lt;EntityName&gt;&#39;</span><span class="p">,</span> <span class="n">headers</span><span class="o">=</span><span class="n">headers</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="n">data</span><span class="p">)</span>
</pre></div>

</div>
<div class="admonition note">
<p class="admonition-title">PHP Example</p>
<div class="codehilite"><pre><span></span><span class="cp">&lt;?php</span>
<span class="k">include</span><span class="p">(</span><span class="s1">&#39;vendor/rmccue/requests/library/Requests.php&#39;</span><span class="p">);</span>
<span class="nx">Requests</span><span class="o">::</span><span class="na">register_autoloader</span><span class="p">();</span>
<span class="nv">$headers</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span>
    <span class="s1">&#39;Authorization&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;Bearer &lt;Token&gt;&#39;</span><span class="p">,</span>
<span class="p">);</span>
<span class="nv">$data</span> <span class="o">=</span> <span class="s1">&#39;{</span>
<span class="s1">            &quot;data&quot;: {</span>
<span class="s1">                &quot;type&quot;: &quot;&lt;EntityName&gt;&quot;,</span>
<span class="s1">                &quot;attributes&quot;: {</span>
<span class="s1">                    &quot;name&quot;: &quot;name&quot;</span>
<span class="s1">                }</span>
<span class="s1">            }</span>
<span class="s1">         }&#39;</span><span class="p">;</span>
<span class="nv">$response</span> <span class="o">=</span> <span class="nx">Requests</span><span class="o">::</span><span class="na">post</span><span class="p">(</span><span class="s1">&#39;/api/&lt;EntityName&gt;&#39;</span><span class="p">,</span> <span class="nv">$headers</span><span class="p">,</span> <span class="nv">$data</span><span class="p">);</span>
</pre></div>

</div>
              
            </div>
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="../update/" class="btn btn-neutral float-right" title="Update">Next <span class="icon icon-circle-arrow-right"></span></a>
      
      
        <a href="../read/" class="btn btn-neutral" title="Read, search, filter"><span class="icon icon-circle-arrow-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <!-- Copyright etc -->
    
  </div>

  Built with <a href="http://www.mkdocs.org">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
      
        </div>
      </div>

    </section>

  </div>

  <div class="rst-versions" role="note" style="cursor: pointer">
    <span class="rst-current-version" data-toggle="rst-current-version">
      
      
        <span><a href="../read/" style="color: #fcfcfc;">&laquo; Previous</a></span>
      
      
        <span style="margin-left: 15px"><a href="../update/" style="color: #fcfcfc">Next &raquo;</a></span>
      
    </span>
</div>
    <script>var base_url = '../..';</script>
    <script src="../../js/theme.js" defer></script>
      <script src="../../search/main.js" defer></script>

</body>
</html>
